unit AddRDocForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
  dxSkinsCore, dxSkinOffice2007Black, dxSkinOffice2007Blue,
  dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver,
  dxSkinOffice2010Black, dxSkinOffice2010Blue, dxSkinOffice2010Silver,
  dxSkinscxPCPainter, dxLayoutControl, cxContainer, cxEdit,
  dxLayoutcxEditAdapters, cxCalc, cxMaskEdit, cxDropDownEdit, cxCalendar,
  cxTextEdit, Menus, StdCtrls, cxButtons;

type
  TForm1 = class(TForm)
    dxLayoutControl1Group_Root: TdxLayoutGroup;
    dxLayoutControl1: TdxLayoutControl;
    NomerEdit: TcxTextEdit;
    dxLayoutControl1Item1: TdxLayoutItem;
    DataEdit: TcxDateEdit;
    dxLayoutControl1Item2: TdxLayoutItem;
    DoDateEdit: TcxDateEdit;
    dxLayoutControl1Item3: TdxLayoutItem;
    NumEdit: TcxCalcEdit;
    dxLayoutControl1Item4: TdxLayoutItem;
    NoteEdit: TcxTextEdit;
    dxLayoutControl1Item5: TdxLayoutItem;
    cxButton1: TcxButton;
    dxLayoutControl1Item6: TdxLayoutItem;
    cxButton2: TcxButton;
    dxLayoutControl1Item7: TdxLayoutItem;
    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure cxButton1Click(Sender: TObject);
    procedure cxButton2Click(Sender: TObject);
  private
    ShemaCode: integer;
  public
    procedure SetData(AShemaCode: integer);
  end;

var
  Form1: TForm1;

implementation

uses
  MainFrm, VDB;

{$R *.dfm}

{ TForm1 }

procedure TForm1.cxButton1Click(Sender: TObject);
begin
  ModalResult:=mrOk;
end;

procedure TForm1.cxButton2Click(Sender: TObject);
begin
  ModalResult:=mrCancel;
end;

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  case Key of
    VK_RETURN: ModalResult:=mrOk;
    VK_CANCEL: ModalResult:=mrCancel;
  end;
end;

procedure TForm1.SetData(AShemaCode: integer);
begin
  ShemaCode:=AShemaCode;
  NomerEdit.EditValue:='';
  DataEdit.EditValue:=Date;
  DoDateEdit.EditValue:=Date+365;
  NumEdit.EditValue:=0;
  NoteEdit.EditValue:='';
end;

end.
